package com.gpscookie.mobile;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;

import de.enough.polish.ui.Form;
import de.enough.polish.ui.Gauge;
import de.enough.polish.ui.Spacer;
import de.enough.polish.ui.StringItem;


public abstract class BasicScreen extends Form implements CommandListener
{
	protected Gauge gaugeProcess;
	protected StringItem labInfo;
	protected StringItem labAd;
	protected Command cmdBack;
	protected BasicScreen parentScreen = null;
	protected GPSCookie globalClass = null;
	
	public BasicScreen(String title, GPSCookie globalClass) {
		super(title);
		this.globalClass = globalClass;		
		this.setCommandListener(this);
	}
	
	public void goBack() {
		if (globalClass != null && parentScreen != null) {
			globalClass.setScreen(parentScreen);
		}
	}
	
	protected void appendAd() {
		//this.append(new Spacer(this.getWidth(), 10));
		//#style adItem
		this.labAd = new StringItem("", GPSCookie.getOneAd());
		this.append(this.labAd);
	}
}
